package com.lovo.controller;

import com.lovo.model.vo.PageVO;
import com.lovo.result.ResponseResult;
import com.lovo.service.StudentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/students")
public class StudentController {
    @Resource
    private StudentService studentService;
    @GetMapping
    @ResponseResult
    public Object show(Integer page, Integer size){
        if(page == null){
            page = 1;
        }
        if(size == null){
            size = 5;
        }
        return studentService.findAll(page,size);
    }
    @DeleteMapping("/{id}")
    @ResponseResult
    public Object delete(@PathVariable Integer id){
        studentService.delete(id);
        return null;
    }
}
